This invention relates to the field of computer graphics and, in particular, to an improved method for CG surface shading using a stored texture map for faster processing.
Computer graphics (CG) systems create display images frame-by-frame from digital data representing mathematically-described objects in a scene. CG systems have been noteworthy recently in creating computer-generated special effects, animated films, interactive 3D video games, and other interactive or 3D effects in digital media. They are widely used for entertainment and advertising, computer aided design, flight simulation and training, and many other applications.
In advanced CG applications, a CG development platform is used to create an overall CG media program and accompanying database of scenes and objects, such as the MAYA(trademark) development platform offered by Alias Wavefront, Inc., of Toronto, Ontario, Canada, which is a subsidiary of Silicon Graphics, Inc. The MAYA(trademark) development platform is a 3D modeling, animation, and rendering software package that has advanced interface, workflow, flexibility, and depth features. MAYA includes many tools used for modeling and animation, including setting keyframes and constraints, inverse kinematics, attaching surfaces to skeletons, character modeling, nurbs modeling, character expressions, particle and dynamics suites for rigid and soft bodies, texturing, and tools for rendering including node-based shaders, anti-aliasing, motion blur, and selective raytracing/raycasting. At the heart of MAYA is MEL, its scripting language. Every action, every part of the interface, and every tool is invoked and described by MEL. It is, therefore, possible to create new tools, combinations of tools, completely modify the interface, and tie MAYA in with other software programs using MEL. Further information about the MAYA(trademark) development platform can be obtained from xe2x80x9cMAYA Software Rendering: A Technical Overviewxe2x80x9d, by Andrew Pierce and Kelvin Sung, published by Alias/Wavefront, 1998, 2000.
The developed CG media program and data files, referred to as xe2x80x9cSHOTxe2x80x9d data files, can then be rendered into a visual display of the CG media program. The rendering process operates on a xe2x80x9cWorld Taskxe2x80x9d which includes many different rendering tasks. The many rendering tasks include many independent operations which lend themselves to efficiencies obtained by parallel processing using multiple CPUs. One renderer capable of doing this is the RENDERMAN(trademark) renderer developed by Pixar Animation Studios of Emeryville, Calif.
However, even with advanced CG systems, the computational intensity of rendering and the large data size of visually rich CG scenes can impose a high computational burden that requires that compromises be made in terms of image quality. For example, the light/color shading of surfaces of objects in an image scene typically requires computing the surface texture for each point on an object""s surface from stored surface characteristic data, then computing the light reflectance characteristic of each such point according to a selected light reflectance model, then computing the reflected light values (typically, its specular and diffuse components) from each such point by applying a light vector from each illumination source (emitted, ambient, diffuse, and specular light) in the scene. Among the different light reflectance models that may be used, the ones based upon the physics of light interaction with surface material characteristics, for example, the bidirectional reflectance distribution function (BDRF), are the most accurate in terms of rendering quality, but among the most expensive (intensive) to compute. As a result, surface shading using a physical light reflectance model such as BRDF has been precluded from use in real-time rendering engines.
Accordingly, it is a principal object of the present invention to provide an improved method for CG surface shading that would allow the use of a physical light reflectance model in real-time CG rendering. It is a particular object of the invention to utilize the bidirectional reflectance distribution function as a physical light reflectance model in real-time CG rendering.
In accordance with the present invention, an improved method for computer graphics (CG) surface shading comprises:
(a) determining surface characteristics and geometry parameters of a surface of an object in a scene during development of a CG program;
(b) determining for a frame of the scene an incoming light direction illuminating the surface of the object and an outgoing direction of viewing the object in the scene;
(c) applying a selected bidirectional reflectance distribution function (BRDF) model to compute light reflectance values for a sampled range of normal direction vectors of light reflectance from the surface of the object in the frame of the scene based upon the incoming and outgoing light directions and the surface characteristics and geometry parameters of the surface of the object;
(d) storing the sampled BRDF values as a texture map of light reflectance for surface shading of the object in the frame of the scene; and
(e) performing surface shading of the object during real-time rendering by applying the sampled BRDF values in correspondence to normal direction vectors for points on the surface of the object in the frame of the scene.
The invention technique employs a selected BRDF model during development of a CG program to compute light reflectance values for a sampled range of normal direction vectors as a texture map to be used later during rendering. The BRDF model is applied with a standard model for distribution of normal direction vectors for a given type of surface, and the BRDF values are computed and stored as a look-up table indexed to the sampled range of normal direction vectors. During real-time rendering, surface shading can be readily processed by using the normal direction vector for any given point to look up the stored BRDF value. Shading with BRDF light reflectance values can be combined in one or more passes with shading of other surface texture characteristics, e.g., a facial skin surface textured with hair and facial features. In this manner, the rich tones of a physical light reflectance model can be obtained even for highly textured surfaces during real-time rendering. Besides standard types of light reflectance models (Torrance-Sparrow, Phong, Strauss, etc.), modified types of BRDF models (e.g., Schlick) may also be used to derive a BRDF texture map.
Other objects, features, and advantages of the present invention will be described in further detail below, with reference to the following drawings: